﻿using System;
using Microsoft.Crm.Sdk;

namespace Crm.Plugins.DuplicateChecker.Data{
    /// <summary>
    /// Base class for Repositories sourcing data from an <c>ICrmService</c>.
    /// </summary>
    public abstract class CrmRepository{
        protected ICrmService _crmService;
        /// <summary>
        /// Initializes a new instance of the <see cref="TargetEntityRepository"/> class.
        /// </summary>
        /// <param name="crmService">The CRM service.</param>
        protected CrmRepository(ICrmService crmService){
            if (crmService == null){
                throw new InvalidOperationException("ICrmService cannot be null.");
            }
            _crmService = crmService;
        }
    }
}